<!--
 * @Author: shy_didi
 * @Date: 2020-06-09 10:05:19
 * @LastEditTime: 2020-06-10 15:54:33
 * @LastEditors: Please set LastEditors
 * @Description: 大赛日程
 * @FilePath: \发明人\fmr\src\pages\home\components\schedule.vue
--> 
<template>
  <div class="schedule">
    <div class="title">
      <p class="title-eng">SCHEDULE</p>
      <p class="title-chi">大赛日程</p>
    </div>
    <ul class="ul-content">
      <li class="li-content" v-for="item of datas" :key="item.id">
        <div class="li-content-div">
          <div class="left">{{item.sort}}</div>
          <div class="right">
            <p class="title">
              <van-image :src="item.cover"></van-image>
              <span>{{item.title}}</span>
            </p>
            <p class="content">{{item.content}}</p>
            <p class="content">{{item.content2}}</p>
          </div>
        </div>
      </li>
    </ul>
  </div>
</template>

<script>
import * as api from "@/request/api/apiList/compete.js";
export default {
  data() {
    return {
      datas: [] //日程数据
    };
  },
  methods: {
    async API_course(id, title, sort, cover, content, content2) {
      let result = {
        id,
        title,
        sort,
        cover,
        content,
        content2
      };
      return api.course(result);
    }
  },
  // computed:{
  //    reverseDatas(){
  //      return this.datas.reverse()
  //   }
  // },
  async created() {
    let res = await this.API_course();
    //console.log(res);
    if (res.data.code === 200) {
      this.datas = res.data.data.reverse();
    }
  }
};
</script>

<style lang="scss" scoped>
@import "@/style/home.scss";
</style>